package com.wing.bill.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 账单付款信息
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("bill_ord_pay_information")
public class BillOrdPayInformation extends BaseEntity<BillOrdPayInformation> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Transferor implements IEnum<Integer> {

        /**
        * 本人
        */
        self(0,"本人"),
        /**
        * 其他人
        */
        other(1,"其他人");

        private int code;
        private String desc;

        Transferor(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum PayMode implements IEnum<Integer> {

        /**
        * 网银转账
        */
        online(0,"网银转账"),
        /**
        * 线下汇款
        */
        offline(1,"线下汇款"),
        /**
        * 现金
        */
        cash(2,"现金"),
        /**
        * 其他
        */
        other(3,"其他");

        private int code;
        private String desc;

        PayMode(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum Currency implements IEnum<Integer> {

        /**
        * 人民币
        */
        RMB(0,"人民币"),
        /**
        * 美元
        */
        dollar(1,"美元"),
        /**
        * 其他
        */
        other(2,"其他");

        private int code;
        private String desc;

        Currency(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 账单编号
     */
    private String billNo;

    /**
     * 付款账户
     */
    private String payAccount;

    /**
     * 付款开户行
     */
    private String payBank;

    /**
     * 付款账号
     */
    private String payNumber;

    /**
     * 付款凭证附件
     */
    private String payFile;

    /**
     * 付款凭证号
     */
    private String payFileNo;

    /**
    * 付款时间
    */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime payTime;

    /**
     * 付款人
     */
    private String payName;

    /**
     * 收款账号
     */
    private String incomeNumber;

    /**
     * 收款账号开户行
     */
    private String incomeBank;

    /**
     * 收款账户
     */
    private String incomeAccount;

    /**
     * 付款金额
     */
    private BigDecimal payMoney;

    /**
     * 结算说明
     */
    private String settleRemark;

    /**
     * 是否本人转账付款
     */
    private Transferor transferor;

    /**
    * 是否本人转账付款描述
    */
    @TableField(exist = false)
    private String transferorDesc;

    public String getTransferorDesc() {
        return transferor == null ? null : transferor.getDesc();
    }

    /**
     * 企业名称
     */
    private String enterpriseName;

    /**
     * 企业id
     */
    private Long enterpriseId;

    /**
     * 付款方式
     */
    private PayMode payMode;

    /**
    * 付款方式描述
    */
    @TableField(exist = false)
    private String payModeDesc;

    public String getPayModeDesc() {
        return payMode == null ? null : payMode.getDesc();
    }

    /**
     * 币种
     */
    private Currency currency;

    /**
    * 币种描述
    */
    @TableField(exist = false)
    private String currencyDesc;

    public String getCurrencyDesc() {
        return currency == null ? null : currency.getDesc();
    }

    public enum Type implements IEnum<Integer> {

        /**
         * 领用
         */
        collect(0,"领用"),
        /**
         * 修磨
         */
        repair(1,"修磨"),
        /**
         * 回收
         */
        recycle(2,"回收");

        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }
    /**
     * 账单类型
     */
    private Type type;

    /**
     * 账单类型描述
     */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }

    @TableField(exist = false)
    private String startTime ;
    @TableField(exist = false)
    private String endTime ;
    @TableField(exist = false)
    private String billTotalMoney ;
    @TableField(exist = false)
    private String billAuditor ;
}
